package Map1;

import java.util.*;

public class linkedHashSet {
    public static void main(String[] args) {
//        Collection<Student> s = new LinkedHashSet<>();
//        s.add(new Student("T1",4));
//        s.add(new Student("T1",1));
//        s.add(new Student("T1",2));
//        s.add(new Student("T1",3));
//        Student max = Collections.max(s);
//        System.out.println(max.getAge());
//        System.out.println(max.getName());
        ArrayList<Integer> list =   new ArrayList<>();
        Collections.addAll(list,6,1,2,3,4,5);
        System.out.println(list);
//
//        Collections.sort(list,(Integer item,Integer item2)->{
//            return item2 - item; // 根据函数做不同处理, 目前是倒序. item-item2 就是正序
//        });
        Collections.sort(list, (o1, o2) -> o2-o1);
        System.out.println(list);

    }
}
